package com.cc.controller;

import com.cc.entity.ChildrenCategory;
import com.cc.entity.ParentCategory;
import com.cc.service.CategoryService;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program:
 * @ClassName:
 * @description:
 * @author: zgc
 * @date:
 * @Version 1.0
 **/
@RestController
@RefreshScope
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    @RequestMapping("/selectParentCategory")
    public List<ParentCategory> selectParentCategory(@RequestBody ParentCategory parentCategory) {
        return categoryService.selectParentCategory(parentCategory);
    }

    @RequestMapping("/selectChildrenCategory")
    public List<ChildrenCategory> selectChildrenCategory(@RequestBody ChildrenCategory childrenCategory) {
        return categoryService.selectChildrenCategory(childrenCategory);
    }

    @RequestMapping("/insertChildrenCategory")
    public Integer insertChildrenCategory(@RequestBody ChildrenCategory childrenCategory) {
        return categoryService.insertChildrenCategory(childrenCategory);
    }

}
